package org.ResearchProject.service.serviceImpl;

import org.ResearchProject.mapper.ResearchTaskMapper;
import org.ResearchProject.pojo.ResearchTask;
import org.ResearchProject.service.ResearchTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.soap.Text;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Map;

/**
 * 2024-12-13-19:28
 */
@Service
public class ResearchTaskServiceImpl implements ResearchTaskService {
    @Autowired
    ResearchTaskMapper researchTaskMapper;
    @Override
    public void addTask(ResearchTask researchTask) {
        researchTaskMapper.addTask(researchTask);
    }

    @Override
    public void deleteTask(Integer taskId) {
        researchTaskMapper.deleteTask(taskId);
    }

    @Override
    public void updateTask(ResearchTask researchTask) {
        researchTaskMapper.updateTask(researchTask);
    }

    @Override
    public Map<String,Object> selectTaskById(Integer taskId) {
        return researchTaskMapper.selectTaskById(taskId);
    }

    @Override
    public ArrayList<Map<String,Object>> TutorSelectAllTask(Integer tutorId) {
        return researchTaskMapper.tutorSelectAllTask(tutorId);
    }

    @Override
    public ArrayList<Map<String,Object>>  StudentSelectAllTask(Integer studentId) {
        return researchTaskMapper.studentSelectAllTask(studentId) ;
    }

    @Override
    public void giveTaskToStudent(Integer taskId, Integer studentId, LocalDateTime startTime, LocalDateTime endTime, Integer tutorId) {
        researchTaskMapper.giveTaskToStudent(taskId, studentId,startTime,endTime,tutorId);
    }

    @Override
    public void submitTask(Integer taskId, String text, Integer studentId) {
        researchTaskMapper.submitTask(taskId, text,studentId);
    }
}
